import PropTypes from 'prop-types'

function Student(props){


    return(
        <div className="student">
            <p>Name: {props.name}</p>
            <p>Age: {props.age}</p>
            <p>Sudent: {props.isStudent ? "Yes" : "No"}</p>
        </div>
    )
}

// 定义props的类型
Student.propTypes = {
    name: PropTypes.string,
    age: PropTypes.number,
    isStudent: PropTypes.bool
}
// 定义props的默认值
Student.defaultProps = {
    name: "guest",
    age: 666,
    isStudent: false
}

export default Student